<template>
  <div class="network">
    <div class="network-container">
      <div class="network-box">
        <div class="tit-line">
          <span class="tit-line1"></span>
          <span class="tit-line2"></span>
        </div>
        <h2 class="solve-tit">{{ networkTit }}</h2>
      </div>

      <div class="network-stats">
        <div
          v-for="(item, index) in networkData"
          :key="index"
          class="stat-item"
        >
          <div class="stat-icon">
            <img :src="baseUrl+item.iconUrl" >
          </div>
          <div class="stat-number">{{ item.statValue }}</div>
          <div class="stat-desc">{{ item.description }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script >
export default {
  props: {
    networkData: {
      type: Array,
      default: () => []
    }
  },
  data(){
    return{
      activeService: 0,
      networkTit:this.$t('contentDetails.globalNetwork'),
    }
  },
  computed: {
    baseUrl() {
      return process.env.VUE_APP_BASE_API
    }
  },
  methods: {
    changeService(index) {
      this.activeService = index;
    },
  }
}
</script>
<style scoped lang="scss">
.network-container {
  max-width: 1200px;
  margin: 80px auto;
  padding: 0 20px;
  text-align: center;
}

.project-tit {
  text-align: left;
  margin-bottom: 50px;
}

.tit-line {
  display: flex;
  justify-content: left;
  margin-bottom: 20px;
}

.tit-line1, .tit-line2 {
  height: 8px;
  background: #fe3231;
  border-radius: 10px;
}

.tit-line1 {
  width: 60px;
}

.tit-line2 {
  width: 10px;
  margin-left: 10px;
}

.solve-tit {
  font-size: 30px;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
  text-align: left;
}

.solve-submit {
  font-size: 16px;
  color: #666;
  line-height: 1.6;
}

.solve-submit span {
  display: block;
  margin-bottom: 5px;
}

.network-box {
  margin-bottom: 60px;
}

.network-stats {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 30px;
}

.stat-item {
  flex: 1;
  min-width: 280px;
  max-width: 350px;
  padding: 40px 20px;
}

.stat-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;

  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

.stat-number {
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 15px;
}

.stat-desc {
  font-size: 16px;
  line-height: 1.6;
  color: #666;
}

/* 媒体查询：为小屏幕设备添加移动端样式 */
@media (max-width: 768px) {
  .network-container {
    margin: 40px auto;
    padding: 0 15px;
  }

  .solve-tit {
    font-size: 24px;
    margin-bottom: 10px;
  }

  .network-stats {
    gap: 20px;
  }

  .stat-item {
    padding: 10px 15px;
    min-width: 240px;
    max-width: 300px;
  }

  .stat-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
  }

  .stat-number {
    font-size: 30px;
    margin-bottom: 10px;
  }

  .stat-desc {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .network-container {
    margin: 30px auto;
    padding: 0 10px;
  }

  .solve-tit {
    font-size: 20px;
    margin-bottom: 8px;
  }

  .network-stats {
    gap: 15px;
  }

  .stat-item {
    padding: 10px 10px;
    min-width: 200px;
    max-width: 250px;
  }

  .stat-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
  }

  .stat-number {
    font-size: 24px;
    margin-bottom: 8px;
  }

  .stat-desc {
    font-size: 12px;
  }
}
</style>
